﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace CopyIt
{
    public partial class TextFileFolderBrowse : UserControl
    {
        public string HeaderText { get; set; }
        public bool ShowNewFolderButton { get; set; }
        public new string Text
        {
            get { return txtFile.Text; }
            set { txtFile.Text = value; }
        }

        public TextFileFolderBrowse()
        {
            InitializeComponent();
            ShowNewFolderButton = false;
        }

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbrDialog = new FolderBrowserDialog();
            fbrDialog.Description = HeaderText;
            fbrDialog.SelectedPath = txtFile.Text;
            fbrDialog.ShowNewFolderButton = ShowNewFolderButton;

            if (fbrDialog.ShowDialog() == DialogResult.OK)
                txtFile.Text = fbrDialog.SelectedPath;
        }
    }
}
